from utils.client import APIClient
from utils.yaml_config import get_yaml


data = get_yaml('alarm.yaml')

class Api_Alarm:

    def __init__(self,client:APIClient):
        self.client = client

    def alarm_front(self):
        alarm_data = data['front']['request']
        return self.client.request(alarm_data['method'],alarm_data['path'])

    def alarm_info(self):
        alarm_data = data['info']['request']
        return self.client.request(alarm_data['method'],alarm_data['path'])        
    
    def alarm_get(self):
        alarm_data = data['get']['request']
        return self.client.request(alarm_data['method'],alarm_data['path'])

    def alarm_top(self):
        alarm_data = data['top']['request']
        return self.client.request(alarm_data['method'],alarm_data['path'])
    
    def alarm_list(self):
        alarm_data = data['list']['request']
        return self.client.request(alarm_data['method'],alarm_data['path'],json=alarm_data['json'])